<script language="javascript" type="application/javascript" src="/js/ajax_form.js"></script>
<script language="javascript" type="application/javascript">
	function post_callback(res){		
		if(res.success){
			if(confirm('提交成功，是否返回列表页？'))
				window.location.replace('/users');
			else
				window.location.reload(true);	
		}		
		else{
			alert(res.message);
		}
	}
</script>
<div class="main">
<div class="body">
  <div id="menu">
  	<a href="/users/edit" class="on"><?php echo $lang['menu_user_add']; ?></a>
    <a href="/users"><?php echo $lang['menu_user_list']; ?></a>
  </div>
  <div id="edit">
    <form method="post" action="/users/save">
    <input type="hidden" name="uid" value="<?php echo $user->user_id; ?>" />
    <table cellpadding="5" cellspacing="0" align="center" >
        <tr>
            <td align="right"><?php echo $lang['field_username'];?>:</td>
            <td><input name="username" type="text" value="<?php echo $user->username; ?>" /></td>
            <td align="left"></td>
        </tr>  
        <tr>
            <td align="right"><?php echo $lang['field_password'];?>:</td>
            <td><input name="password" type="password" /></td>
            <td align="left"></td>
        </tr> 
        <tr>
            <td align="right"><?php echo $lang['field_email'];?>:</td>
            <td><input name="email" type="text" value="<?php echo $user->email; ?>" /></td>
            <td align="left"></td>
        </tr> 
        <tr>
            <td align="right"><?php echo $lang['field_mobile'];?>:</td>
            <td><input name="mobile" type="text" value="<?php echo $user->mobile; ?>" /></td>
            <td align="left"></td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2">
            <input type="submit" value="<?php echo $lang['button_submit'];?>" id="btnSubmit" /> 
            <input type="reset" value="<?php echo $lang['button_reset'];?>"/>
            </td>
        </tr>
    </table>
    </form>
  </div>
</div>
</div>